<?php
abstract class ApiClient {
	protected $client_key;
	protected $timeout;
	protected $token;
	
	
	protected function clearParams($params) {
		foreach ($params as $k => $v) {
			if ($v === null) {
				unset($params[$k]);
			}
		}
	}	
	
	protected function setTimeout($timeout) {
		$this->timeout = $timeout;
	}
	
	abstract public function getData($object, $method, $params, $post, $https = false);
	
	abstract protected function getUrl($object, $method, $https);
	
	abstract protected function getResponse($object, $method, $params, $post, $https);
	
	protected function getPort($https)
	{
		return $https ? '443' : '80';
	}
	
	public function getToken() {
		return  $this->token;
	}
	
	public function setToken($token) {
		return  $this->token = $token;
	}
	
	
} 